<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                >
    <style>
        .column {
            width: 410px;
            vertical-align: top;
        }
        .rowc{
            text-align: right
        }
        .center{
            text-align:center;
            align:center;
        }
    </style>

    <h:form id="form">
        <rich:panel header="类别选择" styleClass="content-hight">
            <rich:toolbar itemSeparator="grid" style="margin-bottom: 10px;">
                <rich:toolbarGroup>
                    <a4j:commandButton value="新增" render="edit" action="#{announceUpdateBean.addType}"/>
                    <a4j:commandButton value="修改" render="edit" action="#{announceUpdateBean.updateType}"/>
                    <a4j:commandButton value="保存" render="edit,errmessage"  action="#{announceUpdateBean.save}"/>
                    <a4j:commandButton value="删除" render="edit,errmessage" action="#{announceUpdateBean.del}"/>
                </rich:toolbarGroup>
            </rich:toolbar>
            
            <h:outputLabel value="*请先选择要编辑公告类别："/>
            
            <h:panelGrid columns="2" width="100%" columnClasses="col1,col2"  id="edit">
                <rich:tree style="width:300px"
                           selectionType="ajax" toggleType="client"
                           render="documentTypeInfo,errmessage"
                           value="#{announceUpdateBean.treenodes}"
                           selectionChangeListener="#{announceUpdateBean.selected}"
                           var="idocumentType">
                    <rich:treeNode>
                        <h:outputText value="[#{idocumentType.data.id}]#{idocumentType.data.name}" />
                    </rich:treeNode>
                </rich:tree>
                <h:panelGroup>
                    <h:panelGrid columns="2" id="documentTypeInfo">
                        <h:outputText value="代码："/>
                        <h:outputText rendered="#{announceUpdateBean.showAble}" value="#{announceUpdateBean.type.id}"/>
                        <h:inputText rendered="#{announceUpdateBean.editAble}"  value="#{announceUpdateBean.type.id}"/>
                        <h:outputText value="名称："/>
                        <h:outputText rendered="#{announceUpdateBean.showAble}"  value="#{announceUpdateBean.type.name}"/>
                         <h:inputText rendered="#{announceUpdateBean.editAble}"  value="#{announceUpdateBean.type.name}"/>
                        <h:outputLabel value="说明："/>
                        <h:outputLabel value="编码命名规则为11-11-11-11-11"/>
                    </h:panelGrid>
                </h:panelGroup>
            </h:panelGrid>
            <br/>
            <h:commandButton value="进行编辑" action="#{announceUpdateBean.editor}"></h:commandButton>
            <rich:message/>
        </rich:panel>
    </h:form>
</ui:composition>
